package com.android.DBTools;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBConnection {
	private static final String url = "jdbc:mysql://127.0.0.1:3306/android";
	private static final String name = "com.mysql.jdbc.Driver";
	private static final String user = "root";
	private static final String password = "";
	private static Connection conn = null;

	public static Connection getCon() throws ClassNotFoundException, SQLException {
		Class.forName(name);
		conn = DriverManager.getConnection(url, user, password);
		return conn;
	}
	public static void closeCon(){
		try {
			conn.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}
